In recent years, apparatuses have been developed based on the MPEG (Moving Picture Experts Group), JVT (Joint Video Team), or other standards which handle image data and, for the purpose of transmitting and storing information having a high efficiency, utilize the redundancy unique to image information so as to compress the data by application of a discrete cosine transform or other orthogonal transform and by motion compensation.
An encoding device of such a standard utilizes local information of the image so as to realize high efficiency encoding.
An image by nature is not readily discernable in deterioration of image quality by the naked eye even when a complex portion in the image is encoded by making the quantization rougher than that for the other portions.
Accordingly, a conventional encoding device divides an image into a plurality of portions, detects a degree of complexity of the image for each portion, roughly quantizes complex portions of the image based on the detection result, and finely quantizes portions which are not complex so as to suppress the influence of deterioration of the image quality and at the same time reduce the amount of data.
The information of the degree of complexity of an image is called “activity”.
A conventional encoding device calculates the activity of the image data to be quantized and generates a quantization scale defining the quantization scale for each picture based on the activity. Namely, it determines an amount of bits assigned to a picture for each picture.
The encoded data generated by the encoding device is stored in a buffer CPB (coded picture buffer) in a decoding device, then the pictures composing the encoded data are sequentially supplied to the decoding unit with a predetermined picture rate for decoding.
Here, the amount of reduction of the amount of stored data of the buffer CPB by the supply of one picture from the buffer CPB to the decoding unit depends upon the amount of data of the picture, that is, the quantization parameter of the picture.
Accordingly, the encoding device must determine the quantization scale so that the buffer CPB of the decoding device does not underflow.